/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.home.tax.model;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author TIN Nguyen
 */
@Entity
@Table(name = "KetQua")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "KetQua.findAll", query = "SELECT k FROM KetQua k"),
    @NamedQuery(name = "KetQua.findBySttHs", query = "SELECT k FROM KetQua k WHERE k.sttHs = :sttHs"),
    @NamedQuery(name = "KetQua.findByTruyThu", query = "SELECT k FROM KetQua k WHERE k.truyThu = :truyThu"),
    @NamedQuery(name = "KetQua.findByPhatVPHC", query = "SELECT k FROM KetQua k WHERE k.phatVPHC = :phatVPHC")})
public class KetQua implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "STT_HS")
    private Integer sttHs;
    @Column(name = "TruyThu")
    private String truyThu;
    @Column(name = "PhatVPHC")
    private String phatVPHC;
    @JoinColumn(name = "STT_HS", referencedColumnName = "STT", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private HoSo hoSo;
    @JoinColumn(name = "MaSoThue", referencedColumnName = "MaSoThue")
    @ManyToOne(optional = false)
    private DoanhNghiep maSoThue;

    public KetQua() {
    }

    public KetQua(Integer sttHs) {
        this.sttHs = sttHs;
    }

    public Integer getSttHs() {
        return sttHs;
    }

    public void setSttHs(Integer sttHs) {
        this.sttHs = sttHs;
    }

    public String getTruyThu() {
        return truyThu;
    }

    public void setTruyThu(String truyThu) {
        this.truyThu = truyThu;
    }

    public String getPhatVPHC() {
        return phatVPHC;
    }

    public void setPhatVPHC(String phatVPHC) {
        this.phatVPHC = phatVPHC;
    }

    public HoSo getHoSo() {
        return hoSo;
    }

    public void setHoSo(HoSo hoSo) {
        this.hoSo = hoSo;
    }

    public DoanhNghiep getMaSoThue() {
        return maSoThue;
    }

    public void setMaSoThue(DoanhNghiep maSoThue) {
        this.maSoThue = maSoThue;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sttHs != null ? sttHs.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KetQua)) {
            return false;
        }
        KetQua other = (KetQua) object;
        if ((this.sttHs == null && other.sttHs != null) || (this.sttHs != null && !this.sttHs.equals(other.sttHs))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.home.tax.model.KetQua[ sttHs=" + sttHs + " ]";
    }
    
}
